package com.basic.business.model.dto;

import com.basic.business.common.config.ValidationGroups;
import com.basic.business.model.entity.SysPermissions;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Set;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 角色表(SysRole)实体类
 *
 * @author huage
 * @since 2021-07-20 14:33:46
 */
@ApiModel("SysRoleDto")
@Data
public class SysRoleDto implements Serializable {

    private static final long serialVersionUID = 908942130472252352L;

    @ApiModelProperty(value = "$column.comment")
    @NotNull(groups = {ValidationGroups.Update.class, ValidationGroups.Delete.class})
    @Min(value = 1, groups = {ValidationGroups.Update.class, ValidationGroups.Delete.class})
    private Integer id;

    public SysRoleDto( Integer id, String roleName, Set<SysPermissions> permissions) {
        this.id = id;
        this.roleName = roleName;
        this.permissions = permissions;
    }

    private String roleId;

    private String roleName;

    private String roleDescription;

    private String createTime;

    private String updateTime;

    @ApiModelProperty(value = "机构id")
    private String orgId;

    /**
     * 角色对应权限集合
     */
    private Set<SysPermissions> permissions;

}
